﻿using YEA.Utilities.Service.Controller;

namespace YEA.Monitor.LogService.States
{
    public enum StateEvent { Started, Errored, Diagnosed, Recovered, Stopped };

    public class StateEventArgs
    {
        public StateEvent state { get; set; }
        public object stateDetails { get; set; }
    }

    public class ServiceStateBase
    {
        public static event System.EventHandler<EventArgs<StateEventArgs>> StatusChanged;

        public void SendStatusEvent( StateEventArgs transitionEvent)
        {
            var e = new EventArgs<StateEventArgs>(transitionEvent);
            if( StatusChanged != null)
            StatusChanged( this, e);
        }
    }
}
